<extend name="Public/base" />

<block name="body"> <script type="text/javascript"
	src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>

<div class="main-title">
	<h2>{:isset($info['id'])?'编辑':'新增'}资讯</h2>
</div>
<div class="tab-wrap">
	<form action="__SELF__" method="post" class="form-horizontal">
		<input type="hidden" name="country" value="{$country}" />
		<div class="form-item">
			<label class="item-label">标题<span class="check-tips">（不能为空）</span></label>
			<div class="controls">
				<input type="text" class="text input-large" name="title" value="{$info.title}">
			</div>
		</div>
		<eq name="country" value="0">
			<div class="form-item">
				<label class="item-label">地区</label>
				<div class="controls no-overview">
		    		<select id="province" class="selectpicker" data-hide-disabled="true" data-size="5" data-live-search="true" name="province_id" title="省份">
		    			<volist name=":getProvinces()" id="vo">
		    				<option value="{$vo.province_id}" <eq name="info.province_id" value="$vo.province_id">selected</eq>>{$vo.province}</option>
		    			</volist>
		    		</select>
		     		<script type="text/javascript">
		     		$(function(){
		     			$('#province').change(function(e){
		     				$('#city, #area').html('');
		     				$('#city, #area').selectpicker('refresh');
		     				
		     				paramter = {format : 'json', province_id : $(this).val()};
		     				
		     				$.post('{:U('Api/Public/getCities')}', paramter, function(data){
		     					if (data.code == 1) {
		     						$.each(data.data, function(i, item){
		     							$('#city').append('<option value="' + item.city_id + '">' + item.city + '</option>');
		     						});
		     						$('#city').selectpicker('refresh');
		     					}
		     				}, 'json');
		     			});
		     		});
		     		</script>
		     		<select id="city" class="selectpicker" data-hide-disabled="true" data-size="5" data-live-search="true" name="city_id" title="城市">
		     			<notempty name="info.province_id">
		     				<volist name=":getCities($info['province_id'])" id="vo">
			      				<option value="{$vo.city_id}" <eq name="info.city_id" value="$vo.city_id">selected</eq>>{$vo.city}</option>
			      			</volist>
		     			</notempty>
		     		</select>
		     		<script type="text/javascript">
		     		$(function(){
		     			$('#city').change(function(e){
		     				$('#area').html('');
		     				$('#area').selectpicker('refresh');
		     				
		     				paramter = {format : 'json', city_id : $(this).val()};
		     				
		     				$.post('{:U('Api/Public/getAreas')}', paramter, function(data){
		     					if (data.code == 1) {
		     						$.each(data.data, function(i, item){
		     							$('#area').append('<option value="' + item.area_id + '">' + item.area + '</option>');
		     						});
		     						$('#area').selectpicker('refresh');
		     					}
		     				}, 'json');
		     			});
		     		});
		     		</script>
		     		<select id="area" class="selectpicker" data-hide-disabled="true" data-size="5" data-live-search="true" name="area_id" title="区县">
		     			<notempty name="info.city_id">
		     				<volist name=":getAreas($info['city_id'])" id="vo">
			      				<option value="{$vo.area_id}" <eq name="info.area_id" value="$vo.area_id">selected</eq>>{$vo.area}</option>
			      			</volist>
		     			</notempty>
		     		</select>
		     	</div>
			</div>
		</eq>
		<div class="form-item">
			<label class="item-label">热门</label>
			<div class="controls">
				<select name="is_hot">
					<option value="0" <eq name="info.is_hot" value="0">selected="selected"</eq>>否</option>
					<option value="1" <eq name="info.is_hot" value="1">selected="selected"</eq>>是</option>
				</select>
			</div>
		</div>
		<div class="form-item">
	     	<label class="item-label">内容</label>
	     	<div class="controls">
	     		<label class="textarea">
	     			<textarea name="content" placeholder="内容">{$info.content}</textarea>
	     			{:hook('adminArticleEdit', array('name'=>'content','value'=>$info['content']))}
	     		</label>
	     	</div>
	    </div>
		<div class="form-item">
			<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">保存</button>
			<button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
		</div>
	</form>
</div>
</block>
<block name="script">
<link rel="stylesheet" type="text/css" href="__STATIC__/bootstrap/css/bootstrap-select.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/bootstrap/css/bootstrap-typeahead.css" />
<script type="text/javascript" src="__STATIC__/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="__STATIC__/bootstrap/js/bootstrap-select.js"></script>
<script type="text/javascript" src="__STATIC__/bootstrap/js/bootstrap-typeahead.js"></script>
<script type="text/javascript" charset="utf-8">
	//导航高亮
	highlight_subnav('{:U('News/index')}');
</script> </block>
